package com.shinhye.mobilelottery.utils;

import org.apache.commons.lang3.StringUtils;

public class TimeUtils {
	/**
	 * Transfer a second time to the String format: xx天xx时xx分
	 * @param secTime
	 * @return
	 */
	public static String getStandardTime(String secTime) {
		StringBuffer result = new StringBuffer();
		if (StringUtils.isNumericSpace(secTime)) {
			int time = Integer.parseInt(secTime);
			int day = time / (24 * 60 * 60);
			result.append(day).append("天");
			if (day > 0) {
				time = time - day * 24 * 60 * 60;
			}
			int hour = time / 3600;
			result.append(hour).append("时");
			if (hour > 0) {
				time = time - hour * 60 * 60;
			}
			int minute = time / 60;
			result.append(minute).append("分");
		}
		return result.toString();
	}
}
